home *** CD-ROM | disk | FTP | other *** search
/ Dr. Windows 3 / dr win3.zip / dr win3 / VISUALBA / BOZOL2.ZIP / TEST.BOZ < prev    next >
Text File  |  1994-02-08  |  36KB  |  721 lines

  1. goto start
  2.  
  3. ====================================================================
  4. October 21, 1993 - Erik Lee Olson, PowerBASIC Tech Support
  5. Port Charlotte, Florida
  6.  
  7. This is a test program for BozoL.  See BOZOL.DOC and BOZOL.REF for a
  8. complete description of how to use and customize BozoL.
  9.  
  10. BozoL and the PowerBASIC interpreter source code are public domain
  11. =====================================================================
  12.  
  13. start (this is the beginning of the program)
  14.  
  15. color 14,1:cls
  16. locate 2,5:print "BozoL test program"
  17. print            "==================" at locate 3,5
  18. color 15,1  print chr 7
  19.  
  20. print        "1. WHAT IS BOZOL?"                              at locate 7,15
  21. print        "2. BOZOL COMMANDS AND FUNCTIONS - STARTER SET"  at locate 8,15
  22. print        "3. BOZOL PROGRAMMING RULES"                     at locate 9,15
  23. print        "4. HOW TO ADD COMMANDS AND FUNCTIONS"           at locate 10,15
  24. print        "5. CALLING BOZOL FROM YOUR OWN PROGRAMS"        at locate 11,15
  25.  
  26. print           "Or type Q to quit"   at locate 13,18  in color 14,1
  27. color 15,1:locate 15,18:input  "Enter a selection --> ",Pick
  28. if eval len pick=0: print chr 7:goto start
  29.  
  30.         goto one   if eval Pick=1
  31.          goto two   if eval Pick=2
  32.           goto three if eval Pick=3
  33.            goto four  if eval Pick=4
  34.             goto five  if eval Pick=5
  35.  
  36. if same upper Pick,"Q": color 7,0: Print "Goodbye!": end
  37. print chr 7:goto start
  38.  
  39. one:
  40. cls with color 1,7
  41. print "        1. WHAT IS BOZOL?"
  42. print ""
  43. print "        BozoL (The Bozo Language) is an extremely simple interpretive"
  44. print "        language written in PowerBASIC.  It is designed to be easy to"
  45. print "        use, easy to modify, and to run as fast as possible."
  46. print ""
  47. print "        Some of the rules in BozoL may seem a bit wierd, but there is a"
  48. print "        reason for this.  After writing a BASIC interpreter (EBASIC.ZIP)"
  49. print "        I discovered that the fundamental design of BASIC makes it"
  50. print "        extremely difficult to parse and interpret with any sort of"
  51. print "        reasonable speed.  BozoL is purposely designed to run as fast"
  52. print "        as possible as an interpreted language."
  53. print ""
  54. gosub pause
  55. print "        Why BozoL?"
  56. print ""
  57. print "        Every now and then a situation may arise where you will want to"
  58. print "        incorporate a command language into your programs.  BozoL can be"
  59. print "        easily modified to do things relevant to your program's needs."
  60. print "        Suppose you have a database program and you want to allow your"
  61. print "        users to program their own custom procedures without having to"
  62. print "        go back to the original source code and add them in."
  63. print ""
  64. print "        BozoL is a language skeleton.  All of the dirty work has been"
  65. print "        done already.  BozoL already contains expression parsing, program"
  66. print "        flow control, basic logic, and other fundamental building blocks"
  67. print "        of a programming language (print, input, variables, etc)."
  68. print ""
  69. gosub pause
  70. print "        BozoL is simple.  There are not a lot of rules, punctuation, or"
  71. print "        wierd symbols in the language.  It is a real beginner's language."
  72. print ""
  73. print "        All you need to do now is add your own custom commands and key-"
  74. print "        words to the language.  See section 4, " CHR 34 "How to add commands and"
  75. print "        functions" CHR 34 " for the exact details on how to do this."
  76. print ""
  77. gosub pause
  78. print "        Prototypes and Applications"
  79. print ""
  80. print "        Suppose you have a library of routines that pop up boxes, print"
  81. print "        menus, display pictures, etc.  You can take these routines and"
  82. print "        make BozoL commands out of them.  For instance, if you have a"
  83. print "        PowerBASIC subroutine that displays a message inside a red box"
  84. print "        on the center of the screen, you can make a BozoL command which"
  85. print "        calls this subroutine.  So now in BozoL you can say"
  86. print ""
  87. print "                REDBOX " CHR 34 "press any key to continue!" CHR 34
  88. print ""
  89. print "        and BozoL will call your subroutine.  Using this technique, you"
  90. print "        can take an entire library, or many libraries, and make BozoL"
  91. print "        commands out of all of those subroutines."
  92. print ""
  93. gosub pause
  94. print "        I'll give you a more advanced example.  Suppose you have a Power-"
  95. print "        BASIC library that features pull-down menus, dialog boxes, list"
  96. print "        boxes, a text editor, and data entry screens.  If you took every"
  97. print "        callable SUB and FUNCTION in this library and made BozoL commands"
  98. print "        out of them, then you could use the BozoL language to write"
  99. print "        really neat user-interface programs, prototypes, or even finished"
  100. print "        products.  Instead of shipping an EXE, you can ship the BozoL"
  101. print "        interpreter along with an interpreted BozoL program that can"
  102. print "        be easily modified by your customers without ever having to"
  103. print "        give them the source code or customizing the program yourself."
  104. print ""
  105. print "        Software upgrades could be faxed to your customers or even"
  106. print "        dictated over the phone."
  107. print ""
  108. gosub pause
  109. print "        Process Control"
  110. print ""
  111. print "        You could use BozoL to control machinery.  You could add commands"
  112. print "        like TURN EVERYTHING OFF or DISPLAY STATUS OF MIXER 1.  By inventing"
  113. print "        commands and adding them to the language you could turn BozoL into"
  114. print "        a high level language that does almost anything, for any purpose."
  115. print "        Users could enter direct statements or run programs that display"
  116. print "        menus and perform certain tasks, and easily add to or modify the"
  117. print "        system without a lot of complicated programming.  Consider these"
  118. print "        possible additions to the language:"
  119. print ""
  120. print "                DISPLAY SCHEMATIC"
  121. print "                BLOCK PHONES"
  122. print "                ELECTRIC FENCES OFF"
  123. print "                DISENGAGE SECURITY IN DINOSAUR EMBRYO LAB"
  124. print ""
  125. gosub pause
  126. print "        With the fundamental building blocks of the language already in"
  127. print "        place (like GOTO, GOSUB, IF, LOAD, RUN, SAVE, PRINT, INPUT, LOCATE,"
  128. print "        COLOR, LET, etc) you can easily build a custom language that works"
  129. print "        well, runs fast, can handle almost any programming task, and can"
  130. print "        call subroutines written in BASIC, C, Assembler, or BozoL.  Since"
  131. print "        most of the nitty gritty is compiled in (like what do do when the"
  132. print "        command BLOCK PHONES is issued) it will almost always seem to"
  133. print "        run just as fast as a compiled program."
  134. print ""
  135. gosub pause
  136. goto start
  137.  
  138.  
  139. two:
  140. cls with color 1,7
  141. print "        2. BOZOL COMMANDS AND FUNCTIONS - STARTER SET"
  142. print ""
  143. print "        As I mentioned in part 1, all of the fundamental building blocks"
  144. print "        of the language, its structure, variable handling and flow control"
  145. print "        have already been built in.  All you need to do is add new key"
  146. print "        words and the code that is executed when BozoL sees the key word."
  147. print ""
  148. print "        These are the key words that are built in to BozoL already:"
  149. print ""
  150. print ""
  151. print "         ASC       ASCII     BE        CALC      CASE      CHR       CLS"
  152. print "         COLOR     CR        EQUAL     EQUALS    EVAL      FALSE     GOSUB"
  153. print "         GOTO      IF        IN        INKEY     INPUT     IS        LCASE"
  154. print "         LEFT      LEN       LET       LIST      LOAD      LOCATE    LOWER"
  155. print "         LTRIM     MID       NOT       PRINT     PROMPT    QUIT      RETURN"
  156. print "         RIGHT     RTRIM     RUN       SAME      SAVE      SET       SUBSTR"
  157. print "         TAB       TO        TRUE      UCASE     UNTIL     UPPER     WHAT"
  158. print "         WHILE     WITH"
  159. print ""
  160. gosub pause
  161. print "        (... and added since this writing...)"
  162. print